package ui.panels.additionalSettings;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import org.apache.log4j.Logger;

import ui.flowManager.expirimentProperties.ExperimentProperties;

public class AdditionalSettingsListener implements ActionListener{
	
	private AdditionalSettingsPanel aSettingsPanel = null;
	private ExperimentProperties 	props = null;
	Logger log = Logger.getLogger(this.getClass());
	
	public AdditionalSettingsListener(AdditionalSettingsPanel panel, 
			ExperimentProperties props)
	{
		this.aSettingsPanel = panel;
		this.props = props;
	}
	
	public void actionPerformed(ActionEvent event) {
		//case ok clicked
		if(event.getSource() == aSettingsPanel.getOkButton())
		{
			log.debug("Additional settings - pressed 'OK'");
			aSettingsPanel.okButtonFunc();
			aSettingsPanel.setEnablePrimePanelAndClose();
		}
		//case cancel clicked
		else if(event.getSource() == aSettingsPanel.getCancelButton())
		{
			log.debug("Additional settings - pressed 'Cancel'");
			aSettingsPanel.setEnablePrimePanelAndClose();
		}
		
	}
}
